package com.wxproject.demo.Config;/*
 *项目名: WXTEST
 *文件名: E
 *创建者: ZQF
 *创建时间:2020/12/24 21:32
 *描述: TODO
 */

import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.WebRequest;
import java.util.Map;

@Component
public class AppErrorAttribute extends DefaultErrorAttributes {
    @Override
    public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
        Map<String, Object> map = super.getErrorAttributes(webRequest, includeStackTrace); // 这里参数可以配置为false
        // 禁止trace 覆盖
        map.put("trace","");
        return map;
    }
}
